package dilmaj.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;

import dilmaj.shared.StarEntryVO;

public class CheckHandler implements ClickHandler {
	private StarEntryVO baseVO;
	private StarServiceAsync starSvc = GWT.create(StarService.class);
	private StarButtonPanel owner;
	
	public CheckHandler(StarEntryVO baseVO, StarButtonPanel owner) {
		this.baseVO=baseVO;
		this.owner=owner;
	}
	
	@Override
	public void onClick(ClickEvent event) {
		// TODO Auto-generated method stub
		if (owner.isChecked())
			baseVO.addAttachment(owner.getData());
		else
			baseVO.removeAttachment(owner.getData());
	}
}
